Skip to content

Conversation

Shreshth3
Copy link
Contributor

@Shreshth3 Shreshth3 commented Oct 11, 2025

Fixes #11040.

Right now, the -v and -o options for zpool list work independently, but when paired, the -v "wins out" and the -o effect is lost. This commit fixes that problem.

Before my change:
(master) ~/zfs$ ./zpool list -v -o name,health mypool
NAME          HEALTH
mypool        ONLINE
  mirror-0   960M   110K   960M        -         -     2%  0.01%      -    ONLINE
    loop17     1G      -      -        -         -      -      -      -    ONLINE
    loop18     1G      -      -        -         -      -      -      -    ONLINE
After my change:
(v-o-option-conflict) ~/zfs$ ./zpool list -v -o name,health mypool
NAME          HEALTH
mypool        ONLINE
  mirror-0    ONLINE
    loop17    ONLINE
    loop18    ONLINE

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@github-actions github-actions bot added the Status: Work in Progress Not yet ready for general review label Oct 11, 2025
@Shreshth3 Shreshth3 marked this pull request as ready for review October 11, 2025 07:29
@github-actions github-actions bot added Status: Code Review Needed Ready for review and testing and removed Status: Work in Progress Not yet ready for general review labels Oct 11, 2025
Copy link
Member

@robn robn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice straightforward fix, good job!

Fixes openzfs#11040.

Right now, the -v and -o options for `zpool list`
work independently, but when paired, the -v
"wins out" and the -o effect is lost. This
commit fixes that problem.

Signed-off-by: Shreshth Srivastava <[email protected]>
@Shreshth3 Shreshth3 force-pushed the v-o-option-conflict branch from 0ed555e to 4c1785c Compare October 17, 2025 04:29
Copy link
Contributor Author

@Shreshth3 Shreshth3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I made the necessary changes.

Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking closer, while it does look like a step in a right direction, I think we should go further now. For example, dedup field has nothing to do with vdevs, but it is present in this code. Same time bclone_ratio absent here is not printed properly:

mav@genoa2:~# zpool list -v -o name,dedup,bclone_ratio,health optane
NAME       DEDUP  BCLONE_RATIO    HEALTH
optane     1.00x         1.00x    ONLINE
  nvd0p1       -    ONLINE
  nvd10p1      -    ONLINE
  nvd11p1      -    ONLINE
  nvd12p1      -    ONLINE
  nvd13p1      -    ONLINE
  nvd1p1       -    ONLINE
  nvd2p1       -    ONLINE
  nvd3p1       -    ONLINE
  nvd4p1       -    ONLINE
  nvd5p1       -    ONLINE
  nvd6p1       -    ONLINE
  nvd7p1       -    ONLINE
  nvd8p1       -    ONLINE
  nvd9p1       -    ONLINE

Can we remove explicit mention of not applicable properties, but instead handle them all universally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Code Review Needed Ready for review and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zpool list -v disregards other options

3 participants